<?php

class CoreConfig implements AbstractConfig
{
    private static $_C = array
    (
        //网站配置
        'WEB_CHARSET'     => 'utf-8',
    	'WEB_DOMAIN_ROOT' => 'http://www.mym.com',
    
        //视图配置
    	'VIEW_IS_AUTO_DISPLAY'   => false,
        'VIEW_IS_USE_LAYOUT'      => true,
    	'VIEW_THEME'             => 'default',
    	'VIEW_THEME_FILE_SUFFIX' => '.php',
    	'VIEW_NO_PIC_FILE'       => '',
    
        //核心配置
    	'CORE_MODULE_NAME'    => 'm',
    	'CORE_ACTION_NAME'    => 'a',
    	'CORE_DEFAULT_MODULE' => 'index',
    	'CORE_DEFAULT_ACTION' => 'index',
    	'CORE_DEBUG'          => true,
    
        //数据库配置
        'DB_DBNAME' => 'mym',
    	'DB_TABLE_PRE' => 'mym_',
    	'DB_CHARSET' => 'utf8',
        'DB_MASTER_CNF' => array
        (
            'host'    => 'localhost',
    		'port'    => '3306',
    		'user'    => 'root',
    		'pwd'     => '123456',
    	    'dbname'  => 'mym',
    		'charset' => 'utf8'
        ),
    	'DB_SLAVES_CNF' => array
        (
            'host'    => 'localhost',
    		'port'    => '3306',
    		'user'    => 'root',
    		'pwd'     => '123456',
    	    'dbname'  => 'mym',
    		'charset' => 'utf8'
        )
    ); 
    
    public static function getConfig($name)
	{
	    if(self::hasConfig($name))
	    {
	        return self::$_C[$name];
	    }
	    return null;
	}
	public static function hasConfig($name)
	{
	    return isset(self::$_C[$name]);
	}
}